package com.n9.qq.android.push;

import com.qq.taf.jce.JceInputStream;
import com.qq.taf.jce.JceOutputStream;
import com.qq.taf.jce.JceStruct;

import java.util.Objects;

/**
 * @author ice
 * @since 2019/2/19 15:10
 */
public class PushReq extends JceStruct {
    private byte[] jceBuf;
    private long lSeq;
    private int type;


    @Override
    public void readFrom(JceInputStream jceInputStream) {
        this.type = jceInputStream.read(this.type, 1, true);
        if (Objects.isNull(jceBuf)) {
            jceBuf = new byte[1];
        }

        this.jceBuf = jceInputStream.read(jceBuf, 2, true);
        this.lSeq = jceInputStream.read(this.lSeq, 3, true);
    }

    @Override
    public void writeTo(JceOutputStream jceOutputStream) {
        jceOutputStream.write(this.type, 1);
        jceOutputStream.write(this.jceBuf, 2);
        jceOutputStream.write(this.lSeq, 3);
    }

    public byte[] getJceBuf() {
        return jceBuf;
    }

    public long getlSeq() {
        return lSeq;
    }

    public int getType() {
        return type;
    }
}
